# from selenium import webdriver
# import time
# from selenium.webdriver.common.action_chains import ActionChains
# # 创建浏览器
# driver = webdriver.Chrome()
# # 打开指定页面
# driver.get('https://www.vcg.com/creative-image/anniu/')

# # 获取所有第一个图片对象
# def huoqulink():
#     elements = driver.find_elements_by_class_name('imgWaper')
#     return elements[0]

# # 下载图片
# def huodelianjie(tudetail):
#     tudetail.click()
#     windows = driver.window_handles
#     driver.switch_to.window(windows[-1]) # 多页面切换定位到该页面
#     jpg = driver.find_element_by_xpath('//*[@class="relativePosition"]/img').get_attribute('src')
#     jpgs = []
#     jpgs.append(jpg)
#     for i in range(30):
#         # 实现隐藏按钮的方法
        
#         xiayiye = driver.find_element_by_xpath('//*[@id="root"]/div[1]/div[2]/div/div/div[1]/div/div[3]')
#         ActionChains(driver).move_to_element(xiayiye)
#         time.sleep(2)
#         jpp = driver.find_element_by_xpath('//*[@class="relativePosition"]/img').get_attribute('src')
#         jpgs.append(jpp)
#     return jpgs
# def photodownload(jpgs):
#     pass

# if __name__ == '__main__':
#     tudetail = huoqulink()
#     jpgs = huodelianjie(tudetail)
#     print(jpgs)
    # photodownload(jpgs)


# 实现冒泡排序
a = [1,2,3,4,5]
def bubblesort(a):
    for i in range(len(a)):
        for j in range(0,len(a) - i - 1):
            if a[j] > a[j + 1 ]:
                a[j],a[j + 1] = a[j + 1],a[j]
    return a
print(bubblesort(a))

# 请判断是不是回文序列
def huiwen(a):
    if a == a[::-1]:
        return True
    else:
        return False
print(huiwen([1,2,3,3,1]))

def huiwen2(a):
    b = a[::-1]
    for i in len(a):
       if a[i] != b[i]:
           return False
    True